package com.zjw.algorithm.test;


class PrintFiled {
    public PrintFiled(String s) {
        System.out.println(s);
    }
}

class ClassSuper {

    public static PrintFiled filed = new PrintFiled("父类静态field 初始化");
    public PrintFiled filed2 = new PrintFiled("父类field2 初始化");

    static {
        System.out.println("父类静态块执行");
    }

    {
        System.out.println("父类方法块执行");
    }

    public ClassSuper() {
        System.out.println("父类构造函数执行");
    }
}

public class ClassInit extends ClassSuper {
    public PrintFiled filed2 = new PrintFiled("子类field2 初始化");

    static {
        System.out.println("子类静态方法块执行");
    }

    public static PrintFiled filed = new PrintFiled("子类静态field 初始化");

    {
        System.out.println("子类方法块执行");
    }

    public ClassInit() {
        System.out.println("子类构造函数执行");
    }


    public static void main(String[] args) {
        ClassInit classInit = new ClassInit();
    }
}
